#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Copyright © 启明星辰 版权所有
# @Time    : 2023/4/10 11:50
# @Author  : 胡浩浩
# @File    : menus.py
# @IDE     : PyCharm
# @description :

from pywebio.output import *
from pywebio.output import clear_scope
from pywebio.session import eval_js


def show_menus():
    """
    菜单

    :return:
    """
    # 设置footer
    eval_js('window.document.querySelector("footer").textContent = "Powered by Venus";')
    clear_scope("menus")
    clear_scope("data_list")
    # put_row([
    #     put_html("<h1>接口管理系统</h1>"),
    # ], size="20%")
    put_row(
        [
            None,
            put_scrollable(put_scope("menus"), height=1000),
            None,
            put_scrollable(put_scope("data_list"), height=1000),
        ], size="0.5% 10% 1%"
    )
    put_column([
        # put_row([
        #     put_image(open('static/策马奔腾.gif', 'rb').read())
        # ]),
        put_collapse("接口管理", [
            put_column([
                put_link("数据大盘", "/data_market"),
                put_link("接口文档", "/show_api"),
                put_link("接口统计", "/api_count"),
                put_link("测试单管理", "/test_sheet"),
                put_link("模块分组", "/group"),
            ])
        ], open=True),
    ], scope="menus")
